package ch.sv7.tool.dbmanager.types;

import java.sql.Connection;
import java.sql.SQLException;

import ch.sv7.tool.log.Logger;

/**
 * TODO: Document me!
 *
 * @author svt
 *
 */
public class TypesInfoFactory {

	private static final Logger log = Logger.getLogger(TypesInfoFactory.class);
	
	private static TypesInfoFactory instance = new TypesInfoFactory();

	private TypesInfoFactory() {
		super();
	}
	
	public static TypesInfoFactory getInstance() {
		return instance;
	}
	
	public TypesInfo getTypesInfo(String dialect, Connection conn) throws SQLException {
		if ("sybase".equals(dialect)){
			return new SybaseStaticTypesInfo();
			//return new SybaseTypesInfo(conn);
		} else if ("sybase-unicode".equals(dialect)) {
			return new SybaseStaticTypesInfo();
			//return new SybaseTypesInfo(conn);
		} else {
			log.warn("Using default ConnectionTypesInfo");
			return new ConnectionTypesInfo(conn);
		}
	}
	
}
